package com.xxl.job.admin.core.util;

/**
 * @author chenlinqing
 * @description:
 * @date: 2025/7/31 14:16
 */
public class TenantContextUtil {
    private static final ThreadLocal<String> CURRENT_TENANT = new InheritableThreadLocal<>();

    public static void setTenantId(String tenantId) {
        CURRENT_TENANT.set(tenantId);
    }

    public static String getTenantId() {
        return CURRENT_TENANT.get();
    }

    public static void clear() {
        CURRENT_TENANT.remove();
    }
}
